foo = [["zs",19],["11",54],["wa",23],["df",23],["xf",23]]

a = sorted(foo, key=lambda x:(x[1],x[0]))
print(a)

a = sorted(foo, key=lambda x:x[0])
print(a)